package 刷题;

import java.util.Scanner;

public class 统计伙食费 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int m=scanner.nextInt();//早
        int n=scanner.nextInt();//中
        int t=scanner.nextInt();//晚
        int s=scanner.nextInt();//月
        int zj=(m+n+t)*s;
        System.out.println(zj);
    }
}
